configfile: "config/config.yaml"

import os

from scripts.utils import target_benchmark_files, target_hyper_search_files


localrules:
    all,
    summary_benchmark,
    summary_hyper_search,
    link_data,
    # run_decipher,
    # run_scvi,
    # run_stagate,
    # calc_metrics,


rule all:
    input:
        "results/benchmark_results.csv",
        # "results/hyper_search.csv",


rule summary_benchmark:
    input:
        target_benchmark_files(config),
    output:
        "results/benchmark_results.csv",
    params:
        pattern=lambda wildcards: "results/{dataset}/seed:{seed}/{method}/metrics.yaml"
    threads: 1
    script:
        "scripts/summarize.py"


rule summary_hyper_search:
    input:
        target_hyper_search_files(config),
    output:
        "results/hyper_search.csv",
    params:
        pattern=lambda wildcards: "results/{dataset}/seed:{seed}/search_decipher/dropout_gex:{dropout_gex}-k:{k}-center_emb_dim:{center_emb_dim}-nbr_emb_dim:{nbr_emb_dim}-epochs:{epochs}-dropout:{dropout}-transformer_layers:{transformer_layers}-temperature_center:{temperature_center}-temperature_nbr:{temperature_nbr}-batch_size:{batch_size}/metrics.yaml"
    threads: 1
    script:
        "scripts/summarize.py"


include: "rules/data.smk"
include: "rules/methods.smk"
include: "rules/metrics.smk"
include: "rules/hyper_search.smk"
